<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="108px"
    >
      <el-form-item label="标准号" prop="a100">
        <el-input
          v-model="queryParams.a100"
          placeholder="请输入标准号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="中文标准名称" prop="a298" >
        <el-input
          v-model="queryParams.a298"
          placeholder="请输入中文标准名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
    <el-row style="margin-top:20px;">
        <el-table
            v-loading="loading"
            :data="standardList"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="标准号" align="center" prop="a100" />
            <el-table-column label="发布日期" align="center" prop="a101" />
            <el-table-column label="标准状态" align="center" prop="a200" />
            <el-table-column label="中文标准名称" align="center" prop="a298" />
            <el-table-column label="代替标准" align="center" prop="a461" />
            <el-table-column label="被代替标准" align="center" prop="a462" />
            <el-table-column label="中国标准分类号" align="center" prop="a825" />
            <el-table-column label="国际标准分类号" align="center" prop="a826" />
            <el-table-column label="电子文件名称" align="center" prop="a893" />
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
            >
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-edit"
                  @click="handleUpdate(scope.row)"
                  v-hasPermi="['system:db15:edit']"
                  >修改</el-button
                >
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-delete"
                  @click="handleDelete(scope.row)"
                  v-hasPermi="['system:db15:remove']"
                  >删除</el-button
                >
              </template>
            </el-table-column>
        </el-table>

        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />

    </el-row>
  </div>
</template>

<script>
import {
  listDb15,
  getDb15,
  delDb15,
  addDb15,
  updateDb15,
} from "@/api/system/db15";
import pdf from 'vue-pdf'
export default {
  name: "dbsearch",
  data() {
    return {
      // 遮罩层
      loading: false,
      // 显示搜索条件
      showSearch: true,
      // Standard表格数据
      standardList: [],
      // 总条数
      total: 0,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        a100: null,
        a298: null
      }
    };
  },
  components: { pdf },
  created() {

  },
  watch: {

  },
  methods: {
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除Standard编号为"' + ids + '"的数据项？')
        .then(function () {
          
        })
        .then(() => {

          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    getList(){
        
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
  },
};
</script>
<style>
.searchrow{
  margin-top:20px;
}


</style>